<template>
  <div class="sec-top row">
    <div class="form-inline">
      <label>手机号:</label>
      <input type="text" class="form-control input-sm" placeholder="输入手机号搜索"  v-model="phone">
      <label>状态:</label>
      <select class="form-control" v-model="status">
        <option value="" selected>全部</option>
        <option value="1" >已注册</option>
        <option value="2" >接受邀请</option>
        <option value="3">接受并注册</option>
        <option value="4" >已开户</option>
        <option value="5" >已交易</option>
        <option value="6">已领奖</option>
      </select>
      <button class="btn btn-primary btn-sm" @click="searchList">搜索用户</button>
    </div>
    &nbsp;&nbsp;&nbsp;&nbsp;
    <!--<div class="form-inline">
      <input type="file" class="form-control input-sm" v-el:settleFile accept=".csv, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet, application/vnd.ms-excel">
      <button class="btn btn-primary btn-sm" @click="importData">导入交易数据</button>
    </div>-->
    <button :disabled="noSelectUser" class="btn btn-sm btn-primary" @click="btnConfirm('')">批量确认发奖</button>
    <vue-import-data :show-import.sync="showImport"></vue-import-data>
  </div>
  <table class="table table-bordered table-hover">
    <caption>用户列表</caption>
    <thead>
      <tr>
        <th class="col-sm-1"><input type="checkbox" v-model="checkAll" >被邀请人手机号</th>
        <th class="col-sm-2">邀请人用户id</th>
        <th class="col-sm-1">状态</th>
        <th class="col-sm-2">交易券商名称</th>
        <th class="col-sm-2">开户时间</th>
        <th class="col-sm-2">交易时间</th>
        <th class="col-sm-2">更新时间</th>
        <th class="col-sm-2"></th>
      </tr>
    </thead>
    <tbody>
      <tr v-for="item in userList">
        <td><input type="checkbox" v-if="+item.status===5 && +item.confirmFlag===0" value={{item.targetPhone}} v-model="checkedPhones" >{{item.targetPhone}}</td>
        <td>{{item.userId}}</td>
        <td>{{item.status | inviteAcStatus}}</td>
        <td>{{item.securityCompanyName}}</td>
        <td>{{item.openAccountTime}}</td>
        <td>{{item.tradingTime}}</td>
        <td>{{item.updateTime}}</td>
        <td>
          <button v-if="+item.status===5 && +item.confirmFlag===0" class="btn btn-sm btn-primary" @click="btnConfirm(item.targetPhone)">确认发奖</button>
          <span v-if="+item.confirmFlag===1">已确认</span>
        </td>
      </tr>
    </tbody>
  </table>
  <vue-pages :pages.sync="pages" :get-list="getList"></vue-pages>
</template>
<script src="./invite-list.js"></script>
<style src="./invite-list.css" scoped></style>
